

#ifndef GLOBALS_H
#define GLOBALS_H

#include <memory>

#include "../GLRenderer.h"

#include <list>
#include <mutex>

class Camera;

extern int g_num_threads;

extern Renderer* g_renderer; 

class EditorState : public RenderState {
public:
	bool wireframe_mode;
	int grid_size;
	bool point_snap;
	std::mutex render_mtx;

	EditorState() : wireframe_mode(false), grid_size(16){
		current_cam = nullptr;
		point_snap = true;
		for( int i = 0 ; i < 16; i++ )
		{
			binded_textures[i] = -1;
		}
	}
};

extern EditorState g_render_state;

extern double	g_cur_time,
				g_delta_time,
				g_prev_time,
				g_time_acc;


class Brush;

//extern Brush* g_brushes;
extern std::list<Brush> g_brushes;

class GLStaticMesh;
extern std::vector<GLStaticMesh> g_static_meshes;

class BaseEntity;
extern std::vector<std::unique_ptr<BaseEntity>> g_entities;

extern int g_num_brushes;


class BuilderBrush;
extern BuilderBrush* g_builder_brush;


#include "Editor.h"
extern std::unique_ptr<SelectionFrame> g_selection_frame;

//class TextureWindow;
#include "TextureWindow.h"
extern std::unique_ptr< TextureWindow > g_tex_window;

#include "ChooseTextureWindow.h"
extern std::unique_ptr< ChooseTextureWindow > g_choose_tex_window;

extern GLTexture g_checker_texture;

#endif
